﻿using SIG.Infrastructure.Configs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace SIG.WebMVC.Filters
{
    public class SIGActionFilterAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
           
                if (SettingsManager.Site.IsClose)
                {
                    filterContext.Result = new RedirectToRouteResult(
                            new RouteValueDictionary { { "controller", "Home" }, { "action", "Closed" } });

                }
              
                base.OnActionExecuting(filterContext);
        }
    }
}